class Solutio1 {
    public static int lengthOfLongestSubstring1(String ss) {
        char[] s = ss.toCharArray();
        int[] hash = new int[128];
        int left = 0,right = 0,ret = 0,n = ss.length();
        while(right < n) {
            hash[s[right]]++;
            while(hash[s[right]] > 1) {
                hash[s[left++]]--;
            }
            ret = Math.max(ret,right - left + 1);
            right++;
        }
        return ret;
    }

    public static void main(String[] args) {
        int count = lengthOfLongestSubstring1("tmmzuxt");
        System.out.println(count);
    }
}